Merge "Add recentChangesLine to ChangesList"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Oct 2015 12:30:11 +0000 (12:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Oct 2015 12:30:11 +0000 (12:30 +0000)
includes/changes/ChangesList.php
includes/changes/EnhancedChangesList.php

index fdc9944..01f10d8 100644 (file)
@@ -76,6 +76,21 @@ class ChangesList extends ContextSource {
                }
        }
 
+       /**
+        * Format a line
+        *
+        * @since 1.27
+        *
+        * @param RecentChange $rc Passed by reference
+        * @param bool $watched (default false)
+        * @param int $linenumber (default null)
+        *
+        * @return string|bool
+        */
+       public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
+               throw new RuntimeException( 'recentChangesLine should be implemented' );
+       }
+
        /**
         * Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag
         * @param bool $value
index 1dcb7ae..f10307d 100644 (file)
@@ -83,15 +83,16 @@ class EnhancedChangesList extends ChangesList {
        /**
         * Format a line for enhanced recentchange (aka with javascript and block of lines).
         *
-        * @param RecentChange $baseRC
+        * @param RecentChange $rc
         * @param bool $watched
+        * @param int $linenumber (default null)
         *
         * @return string
         */
-       public function recentChangesLine( &$baseRC, $watched = false ) {
+       public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
 
                $date = $this->getLanguage()->userDate(
-                       $baseRC->mAttribs['rc_timestamp'],
+                       $rc->mAttribs['rc_timestamp'],
                        $this->getUser()
                );
 
@@ -106,7 +107,7 @@ class EnhancedChangesList extends ChangesList {
                        $this->lastdate = $date;
                }
 
-               $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched );
+               $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $rc, $watched );
                $this->addCacheEntry( $cacheEntry );
 
                return $ret;